<?php

class Security
{
    public static function isAuthenticated()
    {
        return isset($_SESSION["UserId"]);
    }

    public static function checkAuthenticated()
    {
        session_start();
        if (!isset($_SESSION["UserId"])) {
            header("location:login.php");
        }
    }

    public static function logout()
    {
        session_start();
        $_SESSION = Array();
        header("location:login.php");
    }
}

?>